//
//  OrderManagerTableViewCell.m
//  Mahjong
//
//  Created by mc on 16/9/12.
//  Copyright © 2016年 Elliot. All rights reserved.
//

#import "OrderManagerTableViewCell.h"

@implementation OrderManagerTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgViewHead = [[UIImageView alloc] init];
        self.imgViewHead.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_imgViewHead];
        
        self.labelName = [[UILabel alloc] init];
//        _labelName.backgroundColor = [UIColor yellowColor];
        _labelName.textColor = [UIColor grayColor];
        _labelName.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_labelName];
        
        self.labelContent = [[UILabel alloc] init];
//        _labelContent.backgroundColor = [UIColor redColor];
        _labelContent.textColor = [UIColor grayColor];
        _labelContent.font = [UIFont systemFontOfSize:17];
        [self.contentView addSubview:_labelContent];
        
        self.imgViewPOne = [[UIImageView alloc] init];
        self.imgViewPOne.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_imgViewPOne];
        
        self.imgViewPTwo = [[UIImageView alloc] init];
        self.imgViewPTwo.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_imgViewPTwo];
        
        self.imgViewPThree = [[UIImageView alloc] init];
        self.imgViewPThree.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_imgViewPThree];
        
        self.labelNumber = [[UILabel alloc] init];
//        _labelNumber.backgroundColor = [UIColor redColor];
        _labelNumber.textColor = [UIColor grayColor];
        _labelNumber.font = [UIFont systemFontOfSize:17];
        [self.contentView addSubview:_labelNumber];
        
        self.labelData = [[UILabel alloc] init];
//        _labelData.backgroundColor = [UIColor redColor];
        _labelData.textColor = [UIColor grayColor];
        _labelData.font = [UIFont systemFontOfSize:17];
        [self.contentView addSubview:_labelData];
        
        self.lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithWhite:0.900 alpha:1.000];
        [self.contentView addSubview:_lineView];

        
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.imgViewHead.frame = CGRectMake(10, 10, self.contentView.frame.size.height/4 - 20, self.contentView.frame.size.height/4 - 20);
    self.imgViewHead.layer.cornerRadius = (self.contentView.frame.size.height/4 - 20)/2;
    self.labelName.frame = CGRectMake(self.contentView.frame.size.height/4 - 20 + 20, 5,self.contentView.frame.size.width/2, self.contentView.frame.size.height/8 - 5);
    self.labelContent.frame = CGRectMake(self.contentView.frame.size.height/4 - 20 + 20, self.contentView.frame.size.height/8 - 5, self.contentView.frame.size.width/2, self.contentView.frame.size.height/8 - 5);
    
    self.imgViewPOne.frame = CGRectMake(self.contentView.frame.size.width / 8 - 20, self.contentView.frame.size.height / 4, self.contentView.frame.size.width / 4, self.contentView.frame.size.width / 4);
    self.imgViewPTwo.frame = CGRectMake((self.contentView.frame.size.width / 4) + self.contentView.frame.size.width / 8 - 10, self.contentView.frame.size.height / 4, self.contentView.frame.size.width / 4, self.contentView.frame.size.width / 4);
    self.imgViewPThree.frame = CGRectMake((self.contentView.frame.size.width / 4)*2 + self.contentView.frame.size.width / 8 , self.contentView.frame.size.height / 4, self.contentView.frame.size.width / 4, self.contentView.frame.size.width / 4);
    
    
    
    
    self.lineView.frame = CGRectMake(0, self.contentView.frame.size.height - self.contentView.frame.size.height / 7, self.contentView.frame.size.width, self.contentView.frame.size.height / 7);
    
    self.labelNumber.frame = CGRectMake(10, self.contentView.frame.size.height / 4 + self.contentView.frame.size.width / 4, self.contentView.frame.size.width / 2 - 10, self.contentView.frame.size.height / 8);
    self.labelData.frame = CGRectMake(self.contentView.frame.size.width / 2, self.contentView.frame.size.height / 4 + self.contentView.frame.size.width / 4, self.contentView.frame.size.width / 2 - 10, self.contentView.frame.size.height / 8);
    
//
//    self.backView.frame = CGRectMake(0, CGRectGetMaxY(self.lineView.frame) + self.contentView.frame.size.height/30, self.contentView.frame.size.width, self.contentView.frame.size.height - CGRectGetMaxY(self.lineView.frame) - self.contentView.frame.size.height/30);
//    self.imgViewLocation.frame = CGRectMake(8, CGRectGetMaxY(self.lineView.frame) + self.contentView.frame.size.height/30 +5, 15, 15);
//    self.labelLocation.frame = CGRectMake(30, CGRectGetMaxY(self.lineView.frame) , self.contentView.frame.size.width - 40, self.contentView.frame.size.height - CGRectGetMaxY(self.lineView.frame));
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
